Hi,
I wrote a really simple syntax for a loop. Code is here.
No matter what syntax I use, forv or foreach, Stata says "{ is required".
I searched on the web and someone indicates that there are something preventing Stata from reading the "{". But I don't think mine is in line with that.
So what on earth is the problem ?
Maybe that's a little stupid but I really want to figure out what Stata is thinking.
Thank you very much.
I wrote a really simple syntax for a loop. Code is here.
Code:
gen householderID=. forval i=1/15 { replace householderID=Q103ID`i' if Q103a`i'==1 }
Code:
gen householderID=. foreach i of num 1/15 { replace householderID=Q103ID`i' if Q103a`i'==1 }
I searched on the web and someone indicates that there are something preventing Stata from reading the "{". But I don't think mine is in line with that.
So what on earth is the problem ?
Maybe that's a little stupid but I really want to figure out what Stata is thinking.
Thank you very much.
Comment